//
//  XJCmtIdResultViewHeaderView.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/7/13.
//  Copyright © 2018年 Tzyang. All rights reserved.
//  当断不断,反受其乱  -- 《史记 春申君列传》


#import "XJCmtIdResultViewHeaderView.h"
@interface XJCmtIdResultViewHeaderView()
@property (nonatomic, strong) UIImageView *imgView;
@property (nonatomic, strong) UILabel *stateLb;//审核状态lb

@end

@implementation XJCmtIdResultViewHeaderView
#pragma mark - 一 lazy
- (UIImageView *)imgView {
    if (!_imgView) {
        _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"社区认证.png"]];
    }
    return _imgView;
}
- (UILabel *)stateLb {
    if (!_stateLb) {
        _stateLb = [[UILabel alloc] init];
        _stateLb.font = XJFONTSET_R(17.0);
        _stateLb.text = @"社区认证审核中"; //默认文字
        _stateLb.textAlignment = NSTextAlignmentCenter;
    }
    return _stateLb;
}

#pragma mark - 二 init
// 180 + 40 + 15   == 230 //高度至少是230
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}
- (void)setupView {
    [self addSubview:self.imgView];
    [self addSubview:self.stateLb];
}
#pragma mark - 三 layout
- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGFloat k15 = 15.0;
    
    [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(k15);
        make.right.equalTo(self.mas_right).offset(-k15);
        make.top.equalTo(self.mas_top).offset(k15);
        make.height.mas_equalTo(ADAPTHeight(180));
    }];
    [self.stateLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(k15);
        make.right.equalTo(self.mas_right).offset(-k15);
        make.top.equalTo(self.imgView.mas_bottom).offset(k15);
        make.height.mas_equalTo(ADAPTHeight(40));
    }];
}

#pragma mark -  四 configure
- (void)configureXJCmtIdResultViewHeaderViewWithStateLb:(NSString *)stateStr {
    self.stateLb.text = stateStr;
}

@end
